package com.arges.controller;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.arges.baen.AccessTokenVO;

import java.util.Locale;

public class Test2 {


    //    public static void main(String[] args) throws IllegalAccessException {
//        String str = "/hello world!";
////        if ("/".equals(str.substring(0,1))) {
////            System.out.println("...hello");
////            System.out.println(str.substring(1));
////        }else {
////            System.out.println(str);
////        }
//        System.out.println("/hello world!".equals(str) ? "obs" : "ftp");
//
//        String a = "Stay of personnel";
//        a = a.replace(' ', '_');
//        System.out.println(a.toUpperCase());
//    }
    public static void main(String[] args) {
        String json= "{\n" +
                "    \"access_token\":\"OpnJ1TCt3F8Pt9mM4rv3LqcF7id3zLlfX6Lj8uQImVAbIhEOrlgvGl2yS1U6\",\n" +
                "    \"client_id\":\"KPXts1BdMuMVOTd3\",\n" +
                "    \"expires_time\":\"1646981552009\",\n" +
                "    \"openid\":\"dP3UZLJkKqhTSHVI\",\n" +
                "    \"refresh_expires_time\":\"1649487152009\",\n" +
                "    \"refresh_token\":\"q26WN1KZaSVw7Sk0YbswfRyqvNLuzioEo2rIjGxEhht2PFt1QQTlLtLl4a8C\",\n" +
                "    \"scope\":\"userinfo\"\n" +
                "}";

        JSONObject jsonObject = JSON.parseObject(json);
        System.out.println(jsonObject.toString());
        AccessTokenVO accessTokenVO = jsonObject.toJavaObject(AccessTokenVO.class);
        System.out.println(accessTokenVO.toString());
    }

}
